# pragma once
# include <map>
# include <vector>
# include <string>

namespace ZDSJ
{
    class XmlItem
    {
    private:
        std::string* m_item_name = nullptr;
        std::string* m_item_value = nullptr;
        std::vector<XmlItem*>* m_item = nullptr;
        std::map<std::string, std::string>* m_properties = nullptr;
        /* data */
    public:
        XmlItem();
        XmlItem(const std::string& _name);
        XmlItem(const std::string& _name, const std::string& _value);
        void name(const char* _name, size_t _len);
        void value(const char* _value, size_t _len);
        const std::string& name() const;
        const std::string& value() const;
        XmlItem* item(size_t _index);
        const std::vector<XmlItem*>* items() const;
        size_t keys(std::vector<std::string>* _keys) const;
        std::string&& property(const std::string& _key) const;
        void property(const char* _key, size_t _key_len, const char* _value, size_t _value_len);
        void addItem(XmlItem* _value);
        ~XmlItem();
    };
    
    
    
} // namespace name
